﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication1.Models
{
    public class RepositorioNoticia : RepositorioBase
    {

        public void AgregarNoticia(Noticia n)
        {
            db.Noticias.InsertOnSubmit(n);
        }

        public void EliminarNoticia(Noticia n)
        {
            db.Noticias.DeleteOnSubmit(n);
        }

        public IQueryable<Noticia> TodasLasNoticias()
        {
            return db.Noticias;
        }

        public Noticia getNoticia(int indice)
        {
            return db.Noticias.SingleOrDefault(d => d.IDNoticias == indice);
        }

    }
}